<template>
	<view class="space">
		<view class="map-popup" @click="onClick">
			<slot name="close"></slot>
			<view class="popup-img">
				<image v-if="spaceDetail.roundSpaceImgUrl" :src="spaceDetail.roundSpaceImgUrl" mode=""></image>
				<view class="popup_label">{{ spaceDetail.accessRightsDesc }}</view>
			</view>
			<view class="popup-container">
				<view class="u-title">
					{{ spaceDetail.spaceName }}
				</view>
				<view class="swiper-tag" v-if="spaceDetail.labelList">
					<u-tag shape="circle" v-for="(label, index) in spaceDetail.labelList" :key="index" :text="label" bg-color="#FFFAD3" border-color="#FFFAD3" color="#FF7B02" />
				</view>
				<view class="swiper-address">
					<view class="address-text">
						<view class="icon_address"></view>
						<text class="address_text"> {{ spaceDetail.address }}</text>
					</view>
				</view>
				<view class="swiper-bottom">
					<view class="swiper-option">
						<u-icon :name="iconLook" :size="32"></u-icon>
						<view class="grid-text">{{ spaceDetail.browseCount }}</view>
					</view>
					<view class="swiper-option">
						<u-icon :name="iconBubbles" :size="32"></u-icon>
						<view class="grid-text">{{ spaceDetail.bubbleCount }}</view>
					</view>
					<view class="swiper-option">
						<u-icon :name="iconFire" :size="32"></u-icon>
						<view class="grid-text">{{ spaceDetail.vitalityValue }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"space",
		props: ['spaceDetail'],
		data() {
			return {
				iconLook: require('../static/header/icon_eye.png'),
				iconBubbles: require('../static/header/icon_bubbles.png'),
				iconFire: require('../static/header/icon_fire.png'),
			};
		},
		methods: {
			onClick() {
				this.$emit('onClick')
			}
		}
	}
</script>

<style lang="less" scoped>
@import url("../common/css/var.less");
.map-popup {
	margin-left: 32rpx;
	width: 686rpx;
	height: 300rpx;
	background: #FFFFFF;
	box-shadow: 0px 20px 60px rgba(0, 0, 0, 0.05);
	border-radius: 32rpx;
	display: flex;
	align-items: flex-start;
	padding: 32rpx;
	.popup-img {
		position: relative;
		margin-right: 24rpx;
		image {
			width: 128rpx;
			height: 128rpx;
			border-radius: 16rpx;
		}
	}
	.popup_label {
		position: absolute;
		right: 0;
		bottom: 0;
		padding: 0 12rpx;
		height: 40rpx;
		background: #FED034;
		border-radius: 16rpx;
		font-size: 24rpx;
		line-height: 40rpx;
		color: #333333;
	}
	.u-title {
		font-size: 32rpx;
		line-height: 48rpx;
		color: @mText;
		width: 410rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.swiper-tag {
		padding-top: 16rpx;
		u-tag {
			font-size: 24rpx;
			margin-right: 16rpx;
		}
	}
	.swiper-address {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-top: 24rpx;
		.address-text {
			display: flex;
			align-items: center;
			font-size: 28rpx;
			color: @mText;
		}
		.address_text {
			width: 380rpx;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
		.icon_address {
			width: 40rpx;
			height: 40rpx;
			display: inline-block;
			background: url(../static/header/icon_point.png) no-repeat center;
			background-size: contain;
		}
	}
	.swiper-bottom {
		margin-top: 24rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.swiper-option {
		display: flex;
		align-items: center;
		justify-content: center;
		color: @tText;
		font-size: 28rpx;
		u-icon {
			width: 32rpx;
			height: 32rpx;
			margin-right: 8rpx;
		}
	}
}
</style>
